// 公共函数
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

// 路由跳转
Vue.prototype.$goRouter = (url, data) => {
    var url = url;
    if (data) {
        for (const key in data) {
            url += key + "=" + date[key] + "&";
        }
    }

    window.location.href = url;
};

// 正则验证密码
Vue.prototype.$testPSW = (data) => {
    var patrn = /(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{8,12}/;
    if (patrn.test(data)) {
        return true;
    } else {
        return false;
    }
};